<div class="banners index">
<h2><?php __('Banners');?></h2>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Nuevo Banner', true), array('action'=>'add')); ?></li>
	</ul>
</div>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('filename');?></th>
	<th><?php echo $paginator->sort('nombre_banner');?></th>
	<th><?php echo $paginator->sort('en_portada');?></th>
	<th><?php echo $paginator->sort('orden');?></th>
	<th><?php echo $paginator->sort('Departamento','state_id');?></th>
	<th><?php echo $paginator->sort('created');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($banners as $banner):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
		<?php
		  
		         $file =  $filetype->getFile($banner['Banner']['filename']);
		         switch( $file )
		         {
		                case 'swf':
		                        echo $flash->renderSwf('swf/banners/'.$banner['Banner']['filename'],200,120);
		                        break;
		                case 'jpg':
		                        echo $html->image('/files/banners/'.$banner['Banner']['filename'],array('width'=>150));
		                        break;
		                case 'jpeg':
		                        echo $html->image('/files/banners/'.$banner['Banner']['filename'],array('width'=>150));
		                        break;
		              	case 'gif':
		                        echo $html->image('/files/banners/'.$banner['Banner']['filename'],array('width'=>150));
		                        break;
		         }
		        
	         ?>
		</td>
		<td>
			<?php echo $banner['Banner']['nombre_banner']; ?>
		</td>
        <td>
			<?php echo ife($banner['Banner']['en_portada']==1,'SI','NO'); ?>
		</td>
        <td>
			<?php echo $banner['Banner']['orden']; ?>
		</td>

		<td>
			<?php echo $banner['State']['name']; ?>
		</td>
		
		<td>
			<?php echo $time->nice($banner['Banner']['created']); ?>
		</td>
		<td class="actions">
			
			<?php echo $html->link($html->image('pencil.gif',array('alt'=>'Modificar Clasificado','title'=>'Modificar Clasificado')), array('action' => 'edit', $banner['Banner']['id']),array('escape'=>false)); ?>
			<?php echo $html->link($html->image('delete.gif',array('alt'=>'Borrar Clasificado','title'=>'Borrar Clasificado')), array('action' => 'delete', $banner['Banner']['id']),array('escape'=>false), sprintf(__('En realidad desea eliminar  # %s?', true), $banner['Banner']['nombre_banner'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>

